<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- qpainter.cpp -->
  <title>QPaintEngineState Class | Qt GUI 5.14.2</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="../qtdoc/index.html">Qt 5.14</a></td><td ><a href="qtgui-index.html">Qt GUI</a></td><td ><a href="qtgui-module.html">C++ Classes</a></td><td >QPaintEngineState</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtgui-index.html">Qt 5.14.2 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QPaintEngineState Class</h1>
<!-- $$$QPaintEngineState-brief -->
<p>The QPaintEngineState class provides information about the active paint engine's current state. <a href="#details">More...</a></p>
<!-- @@@QPaintEngineState -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QPaintEngineState&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += gui</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign"> Qt 4.1</td></tr></table></div><p>This class was introduced in Qt 4.1.</p>
<ul>
<li><a href="qpaintenginestate-members.html">List of all members, including inherited members</a></li>
<li><a href="qpaintenginestate-obsolete.html">Obsolete members</a></li>
</ul>
<p><b>Note:</b> All functions in this class are <a href="../qtdoc/threads-reentrancy.html">reentrant</a>.</p>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QBrush </td><td class="memItemRight bottomAlign"><b><a href="qpaintenginestate.html#backgroundBrush">backgroundBrush</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::BGMode </td><td class="memItemRight bottomAlign"><b><a href="qpaintenginestate.html#backgroundMode">backgroundMode</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QBrush </td><td class="memItemRight bottomAlign"><b><a href="qpaintenginestate.html#brush">brush</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpaintenginestate.html#brushNeedsResolving">brushNeedsResolving</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPointF </td><td class="memItemRight bottomAlign"><b><a href="qpaintenginestate.html#brushOrigin">brushOrigin</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::ClipOperation </td><td class="memItemRight bottomAlign"><b><a href="qpaintenginestate.html#clipOperation">clipOperation</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath </td><td class="memItemRight bottomAlign"><b><a href="qpaintenginestate.html#clipPath">clipPath</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegion </td><td class="memItemRight bottomAlign"><b><a href="qpaintenginestate.html#clipRegion">clipRegion</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainter::CompositionMode </td><td class="memItemRight bottomAlign"><b><a href="qpaintenginestate.html#compositionMode">compositionMode</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFont </td><td class="memItemRight bottomAlign"><b><a href="qpaintenginestate.html#font">font</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpaintenginestate.html#isClipEnabled">isClipEnabled</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qpaintenginestate.html#opacity">opacity</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainter *</td><td class="memItemRight bottomAlign"><b><a href="qpaintenginestate.html#painter">painter</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPen </td><td class="memItemRight bottomAlign"><b><a href="qpaintenginestate.html#pen">pen</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpaintenginestate.html#penNeedsResolving">penNeedsResolving</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainter::RenderHints </td><td class="memItemRight bottomAlign"><b><a href="qpaintenginestate.html#renderHints">renderHints</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPaintEngine::DirtyFlags </td><td class="memItemRight bottomAlign"><b><a href="qpaintenginestate.html#state">state</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTransform </td><td class="memItemRight bottomAlign"><b><a href="qpaintenginestate.html#transform">transform</a></b>() const</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QPaintEngineState-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>QPaintEngineState records which properties that have changed since the last time the paint engine was updated, as well as their current value.</p>
<p>Which properties that have changed can at any time be retrieved using the <a href="qpaintenginestate.html#state">state</a>() function. This function returns an instance of the <a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyFlags</a> type which stores an OR combination of <a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyFlag</a> values. The <a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyFlag</a> enum defines whether a property has changed since the last update or not.</p>
<p>If a property is marked with a dirty flag, its current value can be retrieved using the corresponding get function:</p>
<a name="getfunction"></a><div class="table"><table class="generic">
 <thead><tr class="qt-style"><th >Property Flag</th><th >Current Property Value</th></tr></thead>
<tr valign="top" class="odd"><td ><a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyBackground</a></td><td ><a href="qpaintenginestate.html#backgroundBrush">backgroundBrush</a>()</td></tr>
<tr valign="top" class="even"><td ><a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyBackgroundMode</a></td><td ><a href="qpaintenginestate.html#backgroundMode">backgroundMode</a>()</td></tr>
<tr valign="top" class="odd"><td ><a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyBrush</a></td><td ><a href="qpaintenginestate.html#brush">brush</a>()</td></tr>
<tr valign="top" class="even"><td ><a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyBrushOrigin</a></td><td ><a href="qpaintenginestate.html#brushOrigin">brushOrigin</a>()</td></tr>
<tr valign="top" class="odd"><td ><a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyClipRegion</a> <i>or</i> <a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyClipPath</a></td><td ><a href="qpaintenginestate.html#clipOperation">clipOperation</a>()</td></tr>
<tr valign="top" class="even"><td ><a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyClipPath</a></td><td ><a href="qpaintenginestate.html#clipPath">clipPath</a>()</td></tr>
<tr valign="top" class="odd"><td ><a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyClipRegion</a></td><td ><a href="qpaintenginestate.html#clipRegion">clipRegion</a>()</td></tr>
<tr valign="top" class="even"><td ><a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyCompositionMode</a></td><td ><a href="qpaintenginestate.html#compositionMode">compositionMode</a>()</td></tr>
<tr valign="top" class="odd"><td ><a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyFont</a></td><td ><a href="qpaintenginestate.html#font">font</a>()</td></tr>
<tr valign="top" class="even"><td ><a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyTransform</a></td><td ><a href="qpaintenginestate.html#transform">transform</a>()</td></tr>
<tr valign="top" class="odd"><td ><a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyClipEnabled</a></td><td ><a href="qpaintenginestate.html#isClipEnabled">isClipEnabled</a>()</td></tr>
<tr valign="top" class="even"><td ><a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyPen</a></td><td ><a href="qpaintenginestate.html#pen">pen</a>()</td></tr>
<tr valign="top" class="odd"><td ><a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyHints</a></td><td ><a href="qpaintenginestate.html#renderHints">renderHints</a>()</td></tr>
</table></div>
<p>The QPaintEngineState class also provide the <a href="qpaintenginestate.html#painter">painter</a>() function which returns a pointer to the painter that is currently updating the paint engine.</p>
<p>An instance of this class, representing the current state of the active paint engine, is passed as argument to the <a href="qpaintengine.html#updateState">QPaintEngine::updateState</a>() function. The only situation in which you will have to use this class directly is when implementing your own paint engine.</p>
</div>
<p><b>See also </b><a href="qpaintengine.html">QPaintEngine</a>.</p>
<!-- @@@QPaintEngineState -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$backgroundBrush[overload1]$$$backgroundBrush -->
<h3 class="fn" id="backgroundBrush"><a name="backgroundBrush"></a><span class="type"><a href="qbrush.html">QBrush</a></span> QPaintEngineState::<span class="name">backgroundBrush</span>() const</h3>
<p>Returns the background brush in the current paint engine state.</p>
<p>This variable should only be used when the <a href="qpaintenginestate.html#state">state</a>() returns a combination which includes the <a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyBackground</a> flag.</p>
<p><b>See also </b><a href="qpaintenginestate.html#state">state</a>() and <a href="qpaintengine.html#updateState">QPaintEngine::updateState</a>().</p>
<!-- @@@backgroundBrush -->
<!-- $$$backgroundMode[overload1]$$$backgroundMode -->
<h3 class="fn" id="backgroundMode"><a name="backgroundMode"></a><span class="type"><a href="../qtcore/qt.html#BGMode-enum">Qt::BGMode</a></span> QPaintEngineState::<span class="name">backgroundMode</span>() const</h3>
<p>Returns the background mode in the current paint engine state.</p>
<p>This variable should only be used when the <a href="qpaintenginestate.html#state">state</a>() returns a combination which includes the <a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyBackgroundMode</a> flag.</p>
<p><b>See also </b><a href="qpaintenginestate.html#state">state</a>() and <a href="qpaintengine.html#updateState">QPaintEngine::updateState</a>().</p>
<!-- @@@backgroundMode -->
<!-- $$$brush[overload1]$$$brush -->
<h3 class="fn" id="brush"><a name="brush"></a><span class="type"><a href="qbrush.html">QBrush</a></span> QPaintEngineState::<span class="name">brush</span>() const</h3>
<p>Returns the brush in the current paint engine state.</p>
<p>This variable should only be used when the <a href="qpaintenginestate.html#state">state</a>() returns a combination which includes the <a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyBrush</a> flag.</p>
<p><b>See also </b><a href="qpaintenginestate.html#state">state</a>() and <a href="qpaintengine.html#updateState">QPaintEngine::updateState</a>().</p>
<!-- @@@brush -->
<!-- $$$brushNeedsResolving[overload1]$$$brushNeedsResolving -->
<h3 class="fn" id="brushNeedsResolving"><a name="brushNeedsResolving"></a><span class="type">bool</span> QPaintEngineState::<span class="name">brushNeedsResolving</span>() const</h3>
<p>Returns whether the coordinate of the fill have been specified as bounded by the current rendering operation and have to be resolved (about the currently rendered primitive).</p>
<p>This function was introduced in Qt 4.3.</p>
<!-- @@@brushNeedsResolving -->
<!-- $$$brushOrigin[overload1]$$$brushOrigin -->
<h3 class="fn" id="brushOrigin"><a name="brushOrigin"></a><span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> QPaintEngineState::<span class="name">brushOrigin</span>() const</h3>
<p>Returns the brush origin in the current paint engine state.</p>
<p>This variable should only be used when the <a href="qpaintenginestate.html#state">state</a>() returns a combination which includes the <a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyBrushOrigin</a> flag.</p>
<p><b>See also </b><a href="qpaintenginestate.html#state">state</a>() and <a href="qpaintengine.html#updateState">QPaintEngine::updateState</a>().</p>
<!-- @@@brushOrigin -->
<!-- $$$clipOperation[overload1]$$$clipOperation -->
<h3 class="fn" id="clipOperation"><a name="clipOperation"></a><span class="type"><a href="../qtcore/qt.html#ClipOperation-enum">Qt::ClipOperation</a></span> QPaintEngineState::<span class="name">clipOperation</span>() const</h3>
<p>Returns the clip operation in the current paint engine state.</p>
<p>This variable should only be used when the <a href="qpaintenginestate.html#state">state</a>() returns a combination which includes either the <a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyClipPath</a> or the <a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyClipRegion</a> flag.</p>
<p><b>See also </b><a href="qpaintenginestate.html#state">state</a>() and <a href="qpaintengine.html#updateState">QPaintEngine::updateState</a>().</p>
<!-- @@@clipOperation -->
<!-- $$$clipPath[overload1]$$$clipPath -->
<h3 class="fn" id="clipPath"><a name="clipPath"></a><span class="type"><a href="qpainterpath.html">QPainterPath</a></span> QPaintEngineState::<span class="name">clipPath</span>() const</h3>
<p>Returns the clip path in the current paint engine state.</p>
<p>This variable should only be used when the <a href="qpaintenginestate.html#state">state</a>() returns a combination which includes the <a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyClipPath</a> flag.</p>
<p><b>See also </b><a href="qpaintenginestate.html#state">state</a>() and <a href="qpaintengine.html#updateState">QPaintEngine::updateState</a>().</p>
<!-- @@@clipPath -->
<!-- $$$clipRegion[overload1]$$$clipRegion -->
<h3 class="fn" id="clipRegion"><a name="clipRegion"></a><span class="type"><a href="qregion.html">QRegion</a></span> QPaintEngineState::<span class="name">clipRegion</span>() const</h3>
<p>Returns the clip region in the current paint engine state.</p>
<p>This variable should only be used when the <a href="qpaintenginestate.html#state">state</a>() returns a combination which includes the <a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyClipRegion</a> flag.</p>
<p><b>See also </b><a href="qpaintenginestate.html#state">state</a>() and <a href="qpaintengine.html#updateState">QPaintEngine::updateState</a>().</p>
<!-- @@@clipRegion -->
<!-- $$$compositionMode[overload1]$$$compositionMode -->
<h3 class="fn" id="compositionMode"><a name="compositionMode"></a><span class="type"><a href="qpainter.html#CompositionMode-enum">QPainter::CompositionMode</a></span> QPaintEngineState::<span class="name">compositionMode</span>() const</h3>
<p>Returns the composition mode in the current paint engine state.</p>
<p>This variable should only be used when the <a href="qpaintenginestate.html#state">state</a>() returns a combination which includes the <a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyCompositionMode</a> flag.</p>
<p><b>See also </b><a href="qpaintenginestate.html#state">state</a>() and <a href="qpaintengine.html#updateState">QPaintEngine::updateState</a>().</p>
<!-- @@@compositionMode -->
<!-- $$$font[overload1]$$$font -->
<h3 class="fn" id="font"><a name="font"></a><span class="type"><a href="qfont.html">QFont</a></span> QPaintEngineState::<span class="name">font</span>() const</h3>
<p>Returns the font in the current paint engine state.</p>
<p>This variable should only be used when the <a href="qpaintenginestate.html#state">state</a>() returns a combination which includes the <a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyFont</a> flag.</p>
<p><b>See also </b><a href="qpaintenginestate.html#state">state</a>() and <a href="qpaintengine.html#updateState">QPaintEngine::updateState</a>().</p>
<!-- @@@font -->
<!-- $$$isClipEnabled[overload1]$$$isClipEnabled -->
<h3 class="fn" id="isClipEnabled"><a name="isClipEnabled"></a><span class="type">bool</span> QPaintEngineState::<span class="name">isClipEnabled</span>() const</h3>
<p>Returns whether clipping is enabled or not in the current paint engine state.</p>
<p>This variable should only be used when the <a href="qpaintenginestate.html#state">state</a>() returns a combination which includes the <a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyClipEnabled</a> flag.</p>
<p><b>See also </b><a href="qpaintenginestate.html#state">state</a>() and <a href="qpaintengine.html#updateState">QPaintEngine::updateState</a>().</p>
<!-- @@@isClipEnabled -->
<!-- $$$opacity[overload1]$$$opacity -->
<h3 class="fn" id="opacity"><a name="opacity"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QPaintEngineState::<span class="name">opacity</span>() const</h3>
<p>Returns the opacity in the current paint engine state.</p>
<p>This function was introduced in Qt 4.2.</p>
<!-- @@@opacity -->
<!-- $$$painter[overload1]$$$painter -->
<h3 class="fn" id="painter"><a name="painter"></a><span class="type"><a href="qpainter.html">QPainter</a></span> *QPaintEngineState::<span class="name">painter</span>() const</h3>
<p>Returns a pointer to the painter currently updating the paint engine.</p>
<!-- @@@painter -->
<!-- $$$pen[overload1]$$$pen -->
<h3 class="fn" id="pen"><a name="pen"></a><span class="type"><a href="qpen.html">QPen</a></span> QPaintEngineState::<span class="name">pen</span>() const</h3>
<p>Returns the pen in the current paint engine state.</p>
<p>This variable should only be used when the <a href="qpaintenginestate.html#state">state</a>() returns a combination which includes the <a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyPen</a> flag.</p>
<p><b>See also </b><a href="qpaintenginestate.html#state">state</a>() and <a href="qpaintengine.html#updateState">QPaintEngine::updateState</a>().</p>
<!-- @@@pen -->
<!-- $$$penNeedsResolving[overload1]$$$penNeedsResolving -->
<h3 class="fn" id="penNeedsResolving"><a name="penNeedsResolving"></a><span class="type">bool</span> QPaintEngineState::<span class="name">penNeedsResolving</span>() const</h3>
<p>Returns whether the coordinate of the stroke have been specified as bounded by the current rendering operation and have to be resolved (about the currently rendered primitive).</p>
<p>This function was introduced in Qt 4.3.</p>
<!-- @@@penNeedsResolving -->
<!-- $$$renderHints[overload1]$$$renderHints -->
<h3 class="fn" id="renderHints"><a name="renderHints"></a><span class="type"><a href="qpainter.html#RenderHint-enum">QPainter::RenderHints</a></span> QPaintEngineState::<span class="name">renderHints</span>() const</h3>
<p>Returns the render hints in the current paint engine state.</p>
<p>This variable should only be used when the <a href="qpaintenginestate.html#state">state</a>() returns a combination which includes the <a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyHints</a> flag.</p>
<p><b>See also </b><a href="qpaintenginestate.html#state">state</a>() and <a href="qpaintengine.html#updateState">QPaintEngine::updateState</a>().</p>
<!-- @@@renderHints -->
<!-- $$$state[overload1]$$$state -->
<h3 class="fn" id="state"><a name="state"></a><span class="type"><a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyFlags</a></span> QPaintEngineState::<span class="name">state</span>() const</h3>
<p>Returns a combination of flags identifying the set of properties that need to be updated when updating the paint engine's state (i.e&#x2e; during a call to the <a href="qpaintengine.html#updateState">QPaintEngine::updateState</a>() function).</p>
<p><b>See also </b><a href="qpaintengine.html#updateState">QPaintEngine::updateState</a>().</p>
<!-- @@@state -->
<!-- $$$transform[overload1]$$$transform -->
<h3 class="fn" id="transform"><a name="transform"></a><span class="type"><a href="qtransform.html">QTransform</a></span> QPaintEngineState::<span class="name">transform</span>() const</h3>
<p>Returns the matrix in the current paint engine state.</p>
<p>This variable should only be used when the <a href="qpaintenginestate.html#state">state</a>() returns a combination which includes the <a href="qpaintengine.html#DirtyFlag-enum">QPaintEngine::DirtyTransform</a> flag.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also </b><a href="qpaintenginestate.html#state">state</a>() and <a href="qpaintengine.html#updateState">QPaintEngine::updateState</a>().</p>
<!-- @@@transform -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2020 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
